﻿''' <summary>
''' MQTT订阅主题管理
''' </summary>
''' <remarks></remarks>
Public Class ManageTopic
    ''' <summary> 获取全部用户信息 </summary>
    Public Const GET_ALL_USER_INFO = "get all user info"
    ''' <summary>
    ''' 获取指定用户.格式：{"sql":"sql查询语句"}
    ''' </summary>
    ''' <remarks></remarks>
    Public Const GET_USER_INFO = "get user info"
    ''' <summary> 设置用户信息（对现有用户设置） </summary>
    Public Const SET_USER_INFO = "set user info"
    ''' <summary> 注册用户 </summary>
    Public Const REG_USER_INFO = "reg user info"
    ''' <summary> 移除用户 </summary>
    Public Const REMOVE_USER = "remove user"
    ''' <summary>用户登录</summary>
    Public Const USER_LOGIN = "user login"
    ''' <summary>用户注销</summary>
    Public Const USER_LOGOUT = "user logout"
    ''' <summary> 获取整个家庭成员组信息 </summary>
    Public Const GET_MEMBER_GROUP = "get member group"
    ''' <summary>创建家庭成员组 </summary>
    Public Const CREATE_MEMBER_GROUP = "create member group"
    ''' <summary>添加家庭成员到组 </summary>
    Public Const ADD_MEMBER_GROUP = "add member group"
    ''' <summary>从家庭成员组移除成员</summary>
    Public Const REMOVE_MEMBER_GROUP = "remove member group"
    ''' <summary>查询指定用户绑定的组id</summary>
    Public Const QUERY_MEMBER_GROUP_ID = "query member group id"
    ''' <summary>查询指定家庭成员组拥有的设备</summary>
    Public Const QUERY_MEMBER_GROUP_DEVICE = "query member group device"
    ''' <summary>添加健康档案信息</summary>
    Public Const ADD_HEALTHY_INFO = "add healthy"
    ''' <summary>查询健康档案信息</summary>
    Public Const QUERY_HEALTHY_INFO = "query healthy"
    ''' <summary>移除指定健康档案信息</summary>
    Public Const REMOVE_HEALTHY_INFO = "remove healthy"
    ''' <summary>注册设备</summary>
    Public Const REG_DEVICE = "register device"
    ''' <summary>编辑设备信息</summary>
    Public Const EDIT_DEVICE = "edit device"
    ''' <summary>移除设备</summary>
    Public Const REMOVE_DEVICE = "remove device"
    ''' <summary>查询设备</summary>
    Public Const QUERY_DEVICE = "query device"
    ''' <summary>设备控制 </summary>
    Public Const CONTROL_DEVICE = "control device"
    ''' <summary>创建授权信息</summary>
    Public Const CREATE_LICENSE_INFO = "create license info"
    ''' <summary>撤销授权</summary>
    Public Const REVOKE_LICENSE_INFO = "revoke license"
    ''' <summary> 执行成功应答（针对无数据返回的应答）(接收和发布) 。格式：{"success":"ok"}</summary>
    Public Const ACK_SUCCESS = "success"
    ''' <summary>执行错误应答。应答格式：{"error":{"code":"错误代码","desc":"错误描述","system_err":false}}</summary>
    Public Const ACK_ERROR = "error"
    ''' <summary>登录成功应答</summary>
    Public Const ACK_LOGIN_SUCCESS = "login success"
    ''' <summary>应答用户信息。对<code>GET_ALL_USER_INFO</code>或<code>GET_USER_INFO</code>主题消息的应答(仅发布，不接收)</summary>
    Public Const ACK_USER_INFO = "return user info"
    ''' <summary>应答家庭成员组信息。对<code>GET_MEMBER_GROUP</code>主题消息的应答(仅发布，不接收) </summary>
    Public Const ACK_MEMBER_GROUP = "return member group"
    ''' <summary>应答家庭成员组id。对<code>QUERY_MEMBER_GROUP_ID</code>消息的应答(仅发布，不接收)</summary>
    Public Const ACK_MEMBER_GROUP_ID = "return member group id"
    ''' <summary>应答家庭成员组设备。对<code>QUERY_MEMBER_GROUP_DEVICE</code>消息的应答(仅发布，不接收)</summary>
    Public Const ACK_MEMBER_GROUP_DEVICE = "return member group device"
    ''' <summary>应答健康档案信息</summary>
    Public Const ACK_HEALTHY_INFO = "return healthy"
    ''' <summary>应答设备信息</summary>
    Public Const ACK_DEVICE_INFO = "return device"
    ''' <summary>授权信息应答</summary>
    Public Const ACK_CREATE_LICENSE_INFO = "return license id"
    ''' <summary>
    ''' 获取主题列表
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared Function getTopics() As String()
        Return {GET_ALL_USER_INFO, GET_USER_INFO, SET_USER_INFO, REG_USER_INFO, REMOVE_USER, USER_LOGIN, USER_LOGOUT, GET_MEMBER_GROUP, CREATE_MEMBER_GROUP, ADD_MEMBER_GROUP, _
                REMOVE_MEMBER_GROUP, QUERY_MEMBER_GROUP_ID, QUERY_MEMBER_GROUP_DEVICE, ADD_HEALTHY_INFO, QUERY_HEALTHY_INFO, REMOVE_HEALTHY_INFO, REG_DEVICE, _
                EDIT_DEVICE, REMOVE_DEVICE, QUERY_DEVICE, CONTROL_DEVICE, ACK_SUCCESS, ACK_ERROR}
    End Function
    ''' <summary>
    ''' 获取主题列表
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared Function getTopicList() As List(Of String)
        Dim topics() As String = getTopics()
        Return topics.ToList
    End Function
End Class
